package com.aaa.os.service;

import com.aaa.os.mapper.OrderMapper;
import com.aaa.os.po.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @fileName:OrderServiceImpl
 * @description:
 * @author:忆尘
 * @createTime:2020/11/3 16:32
 * @version:1.0.0
 */

@Service
public class OrderServiceImpl implements OrderService{

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return orderMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Order> selectAll() {
        List<Order> orders = orderMapper.selectAll();
        Order order = new Order();
        order.setId(2221);
        order.setMemberUsername("提供者2221");
        orders.add(order);
        return orders;
    }

    @Override
    public int insert(Order record) {
        return orderMapper.insert(record);
    }

    @Override
    public int insertSelective(Order record) {
        return orderMapper.insertSelective(record);
    }

    @Override
    public Order selectByPrimaryKey(Integer id) {
        return orderMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Order record) {
        return orderMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Order record) {
        return orderMapper.updateByPrimaryKey(record);
    }
}
